<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script type="text/javascript">

        var a = [1,2,3,4,5,6,7];
        var b = [1,2,4,6];

        var hash={};
        var result=[];

        for(var i=0;i<b.length;i++){
            hash[b[i]] = true;
        }

        for(var j=0;j<a.length;j++){
            if(!hash[a[j]]){
                result.push(a[j]);
            }
       }

        console.log(result);



      </script>
  </body>
</html>
